package com.liang.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liang.subject.infra.basic.entity.SubjectLiked;
import com.liang.subject.infra.basic.service.SubjectLikedService;
import com.liang.subject.infra.basic.mapper.SubjectLikedMapper;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

/**
 * @author 29018
 * @description 针对表【subject_liked(题目点赞表)】的数据库操作Service实现
 * @createDate 2024-11-03 13:05:00
 */
@Service
public class SubjectLikedServiceImpl extends ServiceImpl<SubjectLikedMapper, SubjectLiked>
        implements SubjectLikedService {

    @Override
    public Page<SubjectLiked> getSubjectLikedList(String userId, Page<SubjectLiked> page) {
        return lambdaQuery()
                .eq(SubjectLiked::getLikeUserId, userId)
                .eq(SubjectLiked::getStatus, 1)
                .page(page);
    }
}




